#include <iomanip>
#include <iostream>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'

int n, m;
double fac[15];
int x[15];
double a[25], b[25];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  fac[0] = 1;
  rep(i, 1, 10) fac[i] = fac[i - 1] * i;

  while (cin >> n >> m) {
    rep(i, 1, n) cin >> x[i];
    rep(i, 1, n) if (x[i] > m) x[i] = m;
    rep(i, 0, m) a[i] = 0;
    a[0] = 1;
    rep(i, 1, n) {
      rep(j, 0, m) b[j] = 0;
      rep(j, 0, m) rep(k, 0, x[i]) b[j + k] += a[j] / fac[k];
      rep(j, 0, m) a[j] = b[j];
    }
    double ans = fac[m] * a[m];
    cout << fixed << setprecision(0) << ans << endl;
  }
  return 0;
}